{% extends "xadmin/base_site.html" %}
{% load static %}
{# 导入 样式#}
{% block extrastyle %}
    <link rel="stylesheet" href="{% static 'style.css' %}">
{% endblock %}
{% block content-nav %}
{% endblock %}

{% block content %}
    <nav class="navbar navbar-default navbar-static-top">
      <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav nav-tabs nav-justified">
            <li class="active"><a href="{% url 'xadmin:statisticsQuestion' %}?id={{ meeting_obj.id }}">存在问题 <span class="sr-only">(current)</span></a></li>
            <li><a href="{% url 'xadmin:statisticsResult' %}?id={{ meeting_obj.id }}">结果统计</a></li>
          </ul>
            <input type="text" class="meeting_id" value="{{ meeting_obj.id }}" hidden>
        </div><!-- /.navbar-collapse -->
      </div><!-- /.container-fluid -->
    </nav>
    <div class="top" style="text-align: center">
        <span style="font-size: 20px;">导师未评分的</span>
    </div>
    <div class="content" style="    margin-top: 100px;">
        <table class="table table-hover table-bordered">
        <thead>
            <tr>
              <th style="text-align: center;">学生姓名</th>
              <th style="text-align: center;">学生学号</th>
              <th style="text-align: center;">导师</th>
              <th style="text-align: center;">操作</th>
            </tr>
        </thead>
        <tbody>
        {% for no_check_applicationForm in no_check_applicationForm_list %}
            <tr >
                <td style="text-align: center;">{{ no_check_applicationForm.sname }}</td>
                <td style="text-align: center;">{{ no_check_applicationForm.sno }}</td>
                <td style="text-align: center;">{{ no_check_applicationForm.student.tutor }}</td>
                <td style="text-align: center;"><button type="button" class="btn btn-primary btn-sm remind" data-toggle="modal" data="1" data-target="#change-model" value="{{ no_check_applicationForm.student.tutor.tno }}" {% if meeting.gradeStatus == "已结束" %}  disabled="disabled" {% endif %}>&nbsp;&nbsp;提醒&nbsp;&nbsp;</button></td>
            </tr>
        {% empty %}
            <tr>
                <td  style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
            </tr>
        {% endfor %}
        </tbody>
        </table>
    </div>
    <div class="top" style="text-align: center">
        <span style="font-size: 20px;">未参与互评的学生</span>
    </div>
    <div class="content" style="    margin-top: 100px;">
        <table class="table table-hover table-bordered">
        <thead>
            <tr>
              <th style="text-align: center;">学生姓名</th>
              <th style="text-align: center;">学生学号</th>
              <th style="text-align: center;">导师</th>
              <th style="text-align: center;">操作</th>
            </tr>
        </thead>
        <tbody>
        {% for noTootherGrade in noTootherGrade_list %}
            <tr >
                <td style="text-align: center;">{{ noTootherGrade.sname }}</td>
                <td style="text-align: center;">{{ noTootherGrade.sno }}</td>
                <td style="text-align: center;">{{ noTootherGrade.student.tutor }}</td>
{#                <th><a href="javascript:;" class="change" style="text-decoration-line: none"><span style="color: #4F94CD">修改</span></a></th>#}
                <td style="text-align: center;"><button type="button" class="btn btn-primary btn-sm remind" data="2" data-toggle="modal" data-target="#change-model" data="" value="{{ noTootherGrade.sno }}" {% if meeting.gradeStatus == "已结束" %}  disabled="disabled" {% endif %}>&nbsp;&nbsp;提醒&nbsp;&nbsp;</button></td>
            </tr>
        {% empty %}
            <tr>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
            </tr>
        {% endfor %}
        </tbody>
        </table>
    </div>
    <div class="top" style="text-align: center">
        <span style="font-size: 20px;">未被互评的学生</span>
    </div>
    <div class="content" style="margin-top: 100px;">
        <table class="table table-hover table-bordered">
        <thead>
            <tr>
              <th style="text-align: center;">学生姓名</th>
              <th style="text-align: center;">学生学号</th>
              <th style="text-align: center;">导师</th>
              <th style="text-align: center;">操作</th>
            </tr>
        </thead>
        <tbody>
        {% for nootherGrade in nootherGrade_list %}
            <tr>
                <td style="text-align: center;">{{ nootherGrade.sname }}</td>
                <td style="text-align: center;">{{ nootherGrade.sno }}</td>
                <td style="text-align: center;">{{ nootherGrade.student.tutor }}</td>
                <td style="text-align: center;"><button type="button" class="btn btn-primary btn-sm " data="2" data-toggle="modal" data-target="#change-model" data="" value="{{ noTootherGrade.sno }}" disabled="disabled">&nbsp;&nbsp;暂无&nbsp;&nbsp;</button></td>
            </tr>
        {% empty %}
            <tr>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
            </tr>
        {% endfor %}
        </tbody>
        </table>
    </div>
    <div class="top" style="text-align: center">
        <span style="font-size: 20px;">未提交评委</span>
    </div>
    <div class="content" style="    margin-top: 100px;">
        <table class="table table-hover table-bordered">
        <thead>
            <tr>
              <th style="text-align: center;">评委姓名</th>
              <th style="text-align: center;">评委用户名</th>
              <th style="text-align: center;">操作</th>
            </tr>
        </thead>
        <tbody>
        {% for noSublitJury in noSublitJury_list %}
            <tr>
                <td style="text-align: center;">{{ noSublitJury.jname }}</td>
                <td style="text-align: center;">{{ noSublitJury.jno }}</td>
                <th style="text-align: center;"><button type="button" class="btn btn-primary btn-sm remind" data="3" data-toggle="modal" data-target="#change-model" value="{{ noSublitJury.jno }}" {% if meeting.gradeStatus == "已结束" %}  disabled="disabled" {% endif %}>提醒</button></th>
            </tr>
        {% empty %}
            <tr>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>
                <td style="text-align: center;">暂无内容</td>

            </tr>
        {% endfor %}
        </tbody>
        </table>
    </div>

<script>
// 修改
$(".remind").click(function () {
    // data 用来判断发送的信息内容
    var btn = $(this)
    var data = $(this).attr("data");
    var username = $(this).attr("value");
    var meeting_id = $(".meeting_id").val();
    console.log(username, meeting_id, data)
    $.post("{% url 'xadmin:statisticsQuestion' %}", {"data": data, "username": username, "meeting_id": meeting_id, csrfmiddlewaretoken: '{{ csrf_token }}'}, function (data) {
        alert(data.status)
        if(data.status == "成功"){
            btn.text("已提醒")
        }
    })
})
</script>
{% endblock %}